using Godot;
using System;

public partial class MyAudioStreamPlayer : AudioStreamPlayer
{
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
		if (Input.IsActionJustPressed("右"))
		{
			GD.Print("右键按下");
			
			if (this.StreamPaused == false && this.Playing == false)
			{	
				// 播放
				this.Play();
			}
			// 是否暂停，暂停的话继续播放
			else if (this.StreamPaused)
			{
				// 播放
				this.StreamPaused = false;
				
			}
			else
			{
				// 暂停
				this.StreamPaused = true;
			}
		}

	}
}
